﻿<%@ Page Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true" CodeBehind="ContractView.aspx.cs" Inherits="Runda.CMS.Portal.ContractManage.ContractView" Title="合同查看" %>

<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register assembly="RadCalendar.Net2" namespace="Telerik.WebControls" tagprefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 
    <script src="../Content/jquery-1.3.2.js" type="text/javascript"></script>
    
    <script src="../Content/global.js" type="text/javascript"></script>

    <script src="../Content/Grid/map_grid.js" type="text/javascript"></script>

    <link rel="stylesheet" type="text/css" href="../Content/Grid/mapgrid.css" />
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" />
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Find/find.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../Content/global.css" />
    <script language="javascript" src="../Content/settings.aspx"></script>
    <script src="../Content/lookup/Lookup.js" type="text/javascript"></script>
    <link href="../Content/Form/form.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" src="../Content/Detail.js"></script>
    <script language="javascript" src="../Content/lookup/Lookup.js"></script>
    <script language="javascript" src="../Content/lookup/map_Lookup.js"></script>
    <script language="javascript" src="../Content/Menu/menu.js"></script>
    <script language="javascript" src="../Content/util.js"></script>
    <script type="text/javascript" src="../Content/DateTime/date.js"></script>
    <script type="text/javascript" src="../Content/DateTime/time.js"></script>

    <script type="text/javascript">
        function CheckForm() {

            if (document.getElementById('<%=hiddenUserID.ClientID %>').value == '') {
                alert('请选择客户!');
                return false;
            }
            if (document.getElementById('<%=txtContractCode.ClientID %>').value == '') {
                alert('请输入合同编号!');
                document.getElementById('<%=txtContractCode.ClientID %>').focus();
                return false;
            }

        }

        function AddItem() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }
            openMyFullWin('ContractItemView.aspx?ContractID=' + document.getElementById('<%=txtContractID.ClientID %>').value + '&Type=' + document.getElementById('<%=listContractType.ClientID %>').value, 'addContractItem');
            return false;
        }

        function OpenEditContractItem(val) {
            openMyFullWin('ContractItemView.aspx?ContractID=' + document.getElementById('<%=txtContractID.ClientID %>').value + '&ItemID=' + val, 'editContractItem');
            return false;
        }

        function LoadContractItem() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }

            if ($('#ctl00_cphFormArea_listContractType').val() == '0') {
                loadArea("__appNavBar_areaAddress1", "ContractItemListSaleView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            else {
                loadArea("__appNavBar_areaAddress1", "ContractItemListPutView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            return false;
        }
        function LoadContractProfit() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }
            if ($('#ctl00_cphFormArea_listContractType').val() == '0') {
                loadArea("__appNavBar_areaAddress2", "ContractProfitSaleView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            else {
                loadArea("__appNavBar_areaAddress2", "ContractProfitPutView.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "");
            }
            return false;
        }
        function LoadDocument() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == '') {
                alert('请先保存合同信息!'); return false;
            }
            loadArea("__appNavBar_areaAddress3", "ContractDocument.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "")
            return false;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">
 
    <table class="layout" cellspacing="0" cellpadding="0">
        <colgroup>
            <col width="140">
            <!-- 导航菜单：140px -->
            <col />
        </colgroup>
        <tbody>
            <tr>
                <td class="leftBar">
                    <span class="leftBar" id="appNavBar" defaultarea="__appNavBar_navInfo">
                        <div class="lbItem" tabindex="0" title="主要信息" id="__appNavBar_navInfo" onclick='loadArea("areaForm", "","")'>
                            <img src="/Images/info_16_wihte.gif" align="absmiddle">&nbsp; 主要信息</div>
                        <div class="lbItem" tabindex="1" title="合同明细" onclick='return LoadContractItem();'>
                            <img src="/Images/Info_16_wihte.gif" align="absmiddle">&nbsp; 合同明细</div>
                        <div class="lbItem" tabindex="2" title="利润预算" onclick='return LoadContractProfit();' runat="server" id="divTarget">
                            <img src="/Images/Menu/Customer_30_white.gif" align="absmiddle">&nbsp; 利润预算</div>
                        <div class="lbItem" tabindex="3" title="合同文档" onclick='return LoadDocument();' runat="server" id="divDocument">
                            <img src="/Images/Menu/Customer_21_white.gif" align="absmiddle">&nbsp; 合同文档</div>
                    </span>

                    <script language="javascript">                        function _createIframe() { }</script>

                </td>
                <td id="tdAreas">
                    <div class="area" id="areaForm">
                        <table class="mnubar" cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td width="9">
                                        <img hspace="3" src="../Content/Menu/mnu_vSpacer.gif">
                                    </td>
                                    <td class="icMenu" nowrap>
                                    
                                        <span class="menu" title="关闭" onclick="window.close();">
                                            <img class="mnuBtn" src="../Content/Menu/Close_16_blue.gif"><span class="mnuBtn">关闭</span></span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
                        </div>
                        <div id="areaForm2" class="area">
                            <table cellspacing="0" cellpadding="0" width="100%" height="190px">
                                <tbody>
                                    <tr>
                                        <td valign="top">
                                            <div style="display: inline" id="appForm_tab0" class="tab">
                                                <asp:HiddenField ID="txtContractID" runat="server" />
                                                <table style="table-layout: fixed" id="Section1" cellspacing="0" cellpadding="3" width="100%">
                                                    <colgroup>
                                                        <col width="110">
                                                        <col>
                                                        <col width="110">
                                                        <col>
                                                    </colgroup>
                                                    <tbody>
                                                            <tr>
                                                                <td class="req">
                                                                    客户
                                                                </td>
                                                                <td>
                                                                    <table cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%">
                                                                        <tr>
                                                                            <td nowrap>
                                                                                <div class="lu" detailpage="/SyncManage/CustomerInfo.aspx?CustomerID=">
                                                                                    <span id="hiddenuserName" runat="server" class="lui" oid="" onclick="openlui();">
                                                                                    </span>&nbsp;</div>
                                                                            </td>
                                                                            <td style="text-align: right;" width="25">
                                                                                <img class="lu2" features="dialogWidth:450px;dialogHeight:500px;resizable:yes;center:yes;status:no;help:no;scroll:no;"
                                                                                    lookupbrowse="" lookupclass="" lookupcustom="/lookup/selectcustomeroflookup.aspx?title=customer"
                                                                                    lookupstyle="single" src="../Images/btn_off_lookup.gif" /><input id="hiddenUserID"
                                                                                        runat="server" class="lu" maptype="lu" name="customerGUID" type="hidden" value="" />
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="req">
                                                                    合同编号
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtContractCode" runat="server" CssClass="input"></asp:TextBox>
                                                                </td>
                                                                <td align="right">
                                                                    合同属性
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="listContractAttribute" runat="server" CssClass="selectBox">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    合同申请日期
                                                                </td>
                                                                <td>
                                                                    <rad:RadDatePicker ID="txtContractApplyDate" Runat="server" Culture="Chinese (People's Republic of China)" Skin="WebBlue" Width="100%">
                                                                    <DateInput Skin="WebBlue"></DateInput>
                                                                        <Calendar Skin="WebBlue"></Calendar>
                                                                    </rad:RadDatePicker>
                                                                </td>
                                                                <td align="right">
                                                                    合同签约日期
                                                                </td>
                                                                <td> 
                                                                 
                                                                    <rad:RadDatePicker ID="txtContractEstimateSignDate" Runat="server" Culture="Chinese (People's Republic of China)" Skin="WebBlue" Width="100%">
                                                                    <DateInput Skin="WebBlue"></DateInput>
                                                                        <Calendar Skin="WebBlue"></Calendar>
                                                                    </rad:RadDatePicker>
                                                                 
                                                                </td> 
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    合同类型
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="listContractType" runat="server" CssClass="selectBox"></asp:DropDownList>
                                                                </td>
                                                                <td align="right">
                                                                  
                                                                </td>
                                                                <td> 
                                                                </td>
                                                            </tr>
                                                            <tr>                                                                
                                                                <td align="left">
                                                                    合同条款
                                                                </td>
                                                                <td colspan="3">
                                                                    <asp:TextBox ID="txtContractStatement" runat="server" CssClass="input" Height="49px" TextMode="MultiLine"></asp:TextBox>
                                                                 </td>                                                                
                                                            </tr>
                                                              <tr>
                                                                <td align="left">
                                                                    &nbsp;</td>
                                                                <td colspan="3">
                                                                    当合同总金额达到<rad:RadNumericTextBox ID="radtxtReachTo" runat="server"></rad:RadNumericTextBox>的时候，返还利率<rad:RadNumericTextBox ID="radtxtRebate" runat="server" Width="50px">
<NumberFormat AllowRounding="True"></NumberFormat>
                                                                    </rad:RadNumericTextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="left">
                                                                    <asp:Literal ID="ltlChangeTitle" runat="server" Text="合同变更备注"></asp:Literal>
                                                                </td>
                                                                <td colspan="3">
                                                                    <asp:Panel ID="pnlChange" runat="server">
                                                                        <asp:HyperLink ID="lnkOrginalContract" runat="server">原始合同</asp:HyperLink>
                                                                        <asp:TextBox ID="txtChangeRemark" runat="server" TextMode="MultiLine" CssClass="input" Height="60px"></asp:TextBox>
                                                                    </asp:Panel>
                                                                </td>
                                                            </tr>                                                        
                                                        </tbody>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="margin: 5px 0 5px 0">
                            </div> 
                            
                            <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
                            </div>
                            
                            <div style="margin: 5px 0 5px 0">
                            </div>
                            <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
                                <tbody>
                                    <tr>
                                        <td style="padding-left: 5px" nowrap>
                                            <b>审批流程列表</b>
                                        </td>
                                        <td style="padding-left: 5px">
                                            <img src="../Content/Grid/separator.gif">
                                        </td>
                                        <td class="icMenu" nowrap>
                                        </td>
                                        <td class="icMenu mnuRight" nowrap>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
                            </div>
                            <asp:Repeater ID="RepeaterApprove" runat="server">
                                <HeaderTemplate>
                                    <table id="gridcheck" class="grid" cellspacing="0" cellpadding="0">
                                        <tbody>
                                            <tr class="header">
                                                <td align="middle">
                                                    <div>
                                                        <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                            text-align: center;">
                                                            审批人</div>
                                                        <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                            <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                                    </div>
                                                </td>
                                                <td align="middle">
                                                    <div>
                                                        <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                            text-align: center;">
                                                            审批时间</div>
                                                        <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                            <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                                    </div>
                                                </td>
                                                <td align="middle">
                                                    <div>
                                                        <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                            text-align: center;">
                                                            状态</div>
                                                        <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                            <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                                    </div>
                                                </td>
                                                <td align="middle">
                                                    <div>
                                                        <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                            text-align: center;">
                                                            意见</div>
                                                        <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                            <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                                    </div>
                                                </td>
                                            </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr class="data">
                                        <td>
                                            <%#Eval("CheckName")%>
                                        </td>
                                        <td>
                                            <%#Eval("CheckDate")%>
                                        </td>
                                        <td>
                                            <%#GetStatusText(Convert.ToInt32(Eval("CheckStatus")))%>
                                        </td>
                                        <td>
                                            <%#Eval("Comment")%>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </tbody> </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="statusBar" colspan="2">
                </td>
            </tr>
        </tbody>
    </table>
</asp:Content>
